/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Prototypes;

import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JPanel;

/**
 *
 * @author Moulde
 */
public class JImagePanel extends JPanel
{
    private BufferedImage image;

    public JImagePanel(String path)
    {
        try
        {
            image = ImageIO.read(new File(path));
        }
        catch (IOException ex)
        {
            System.out.println(ex.toString());
        }
    }

    @Override
    public void paintComponent(Graphics g)
    {
        g.drawImage(image, 0, 0, null); // see javadoc for more info on the parameters
    }
}
